//
//  UIFont+XHExtension.h
//  XHFoundationModule
//
//  Created by xinph on 2020/3/12.
//  Copyright © 2020 xinph. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
 *  苹方字体 iOS9.0+出现  需要做适配
 *  这个分类主要用来 字体...
 (
 "PingFangSC-Ultralight",
 "PingFangSC-Regular",
 "PingFangSC-Semibold",
 "PingFangSC-Thin",
 "PingFangSC-Light",
 "PingFangSC-Medium"
 )
 */

// IOS版本
#define XHIOSVersion ([[[UIDevice currentDevice] systemVersion] floatValue])


/// 设置系统的字体大小（YES：粗体 NO：常规）
#define XHFont(__size__,__bold__) ((__bold__)?([UIFont boldSystemFontOfSize:__size__]):([UIFont systemFontOfSize:__size__]))

/// 极细体
#define XHUltralightFont(__size__) ((XHIOSVersion<9.0)?XHFont(__size__ , YES):[UIFont xh_fontForPingFangSC_UltralightFontOfSize:__size__])

/// 纤细体
#define XHThinFont(__size__)       ((XHIOSVersion<9.0)?XHFont(__size__ , YES):[UIFont xh_fontForPingFangSC_ThinFontOfSize:__size__])

/// 细体
#define XHLightFont(__size__)      ((XHIOSVersion<9.0)?XHFont(__size__ , YES):[UIFont xh_fontForPingFangSC_LightFontOfSize:__size__])

// 中等
#define XHMediumFont(__size__)     ((XHIOSVersion<9.0)?XHFont(__size__ , YES):[UIFont xh_fontForPingFangSC_MediumFontOfSize:__size__])

// 常规
#define XHRegularFont(__size__)    ((XHIOSVersion<9.0)?XHFont(__size__ , NO):[UIFont xh_fontForPingFangSC_RegularFontOfSize:__size__])

/** 中粗体 */
#define XHSemiboldFont(__size__)   ((XHIOSVersion<9.0)?XHFont(__size__ , YES):[UIFont xh_fontForPingFangSC_SemiboldFontOfSize:__size__])



/// 苹方常规字体 10
#define XHRegularFont_10 XHRegularFont(10.0f)
/// 苹方常规字体 11
#define XHRegularFont_11 XHRegularFont(11.0f)
/// 苹方常规字体 12
#define XHRegularFont_12 XHRegularFont(12.0f)
/// 苹方常规字体 13
#define XHRegularFont_13 XHRegularFont(13.0f)
/** 苹方常规字体 14 */
#define XHRegularFont_14 XHRegularFont(14.0f)
/// 苹方常规字体 15
#define XHRegularFont_15 XHRegularFont(15.0f)
/// 苹方常规字体 16
#define XHRegularFont_16 XHRegularFont(16.0f)
/// 苹方常规字体 17
#define XHRegularFont_17 XHRegularFont(17.0f)
/// 苹方常规字体 18
#define XHRegularFont_18 XHRegularFont(18.0f)
/// 苹方常规字体 19
#define XHRegularFont_19 XHRegularFont(19.0f)
/// 苹方常规字体 20
#define XHRegularFont_20 XHRegularFont(20.0f)


@interface UIFont (XHExtension)

/**
 *  苹方极细体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_UltralightFontOfSize:(CGFloat)fontSize;

/**
 *  苹方常规体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_RegularFontOfSize:(CGFloat)fontSize;

/**
 *  苹方中粗体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_SemiboldFontOfSize:(CGFloat)fontSize;

/**
 *  苹方纤细体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_ThinFontOfSize:(CGFloat)fontSize;

/**
 *  苹方细体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_LightFontOfSize:(CGFloat)fontSize;

/**
 *  苹方中黑体
 *
 *  @param fontSize 字体大小
 *
 */
+(instancetype) xh_fontForPingFangSC_MediumFontOfSize:(CGFloat)fontSize;


@end

NS_ASSUME_NONNULL_END
